import Vue from 'vue'
import VueRouter from 'vue-router'
import province from '../views/province'

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  if (typeof location == 'string') {
    var Separator = '&'
    if (location.indexOf('?') == -1) {
      Separator = '?'
    }
    location = location + Separator + 'random=' + Math.random()
  }
  return routerPush.call(this, location).catch(error => error)
}
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'province',
    component: province
  }
]

const router = new VueRouter({
  routes
})

export default router
